<?php

namespace Cck\ArticlesSystem\Http\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;

/**
 * 设置分组
 * 
 * @property string $name
 * @property boolean $enable
 * 
 * @property-read Setting[]|Collection $settings
 */
class SettingGroup extends Model
{
    protected $table = 'setting_groups';

    public $timestamps = false;

    protected $fillable = [
        'name', 'enable', 'display_name', 'order'
    ];

    protected $casts = [
        'enable' => 'boolean'
    ];

    public function settings()
    {
        return $this->hasMany(Setting::class, 'group_id', 'id');
    }
}
